package com.yhq.ojbackendmodel.model.codesandbox;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.codec.digest.DigestUtils;

import java.util.List;

/**
 * @program: oj-backend
 * @description: 执行代码请求
 * @author: HenryYang
 * @create: 2023-08-23 15:18
 **/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ExcuteCodeRequest {

    /**
     * 一组输入
     */
    private List<String> inputList;
    /**
     * 代码
     */
    private String code;
    /**
     * 编程语言
     */
    private String language;

    public String generateSign(String seed) {
        String key = seed;
        // 生成md5的值
        return DigestUtils.md5Hex(key);
    }
}